package com.example.demo.service;

import com.example.demo.pojo.User;
import com.example.demo.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class UserService {

    @Resource
    public UserMapper userMapper;

    public User selectByName(String userName){
        return userMapper.getUserByName(userName);
    }

    //注册
    public int insert(User user){
        return userMapper.addUser(user);
    }

}
